From: Richard M. Stallman Date: Thu, 27 May 1993 05:53:05 +0000 (+0000) Subject: (x_get_resource_string): New function. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~95887 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=3402e1a480f8276aadd6ff136f5547f3d39e8414;p=emacs.git (x_get_resource_string): New function. --- diff --git a/src/xfns.c b/src/xfns.c index 7f8f659bd21..4614b97ba1d 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1151,6 +1151,31 @@ and the class is `Emacs.CLASS.SUBCLASS'.") return Qnil; } +/* Used when C code wants a resource value. */ + +char * +x_get_resource_string (attribute, class) + char *attribute, *class; +{ + register char *value; + char *name_key; + char *class_key; + + /* Allocate space for the components, the dots which separate them, + and the final '\0'. */ + name_key = (char *) alloca (XSTRING (Vinvocation_name)->size + + strlen (attribute) + 2); + class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) + + strlen (class) + 2); + + sprintf (name_key, "%s.%s", + XSTRING (Vinvocation_name)->data, + attribute); + sprintf (class_key, "%s.%s", EMACS_CLASS, class); + + return x_get_string_resource (xrdb, name_key, class_key); +} + #else /* X10 */ DEFUN ("x-get-default", Fx_get_default, Sx_get_default, 1, 1, 0,